package cn.chrilwe.pigpig.core.model.filesystem;

import cn.chrilwe.autocreatetable.start.annotation.Entity;
import cn.chrilwe.autocreatetable.start.annotation.mysql.AutoIncrement;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Column;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Notnull;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Primary;
import cn.chrilwe.autocreatetable.start.annotation.mysql.Table;
import cn.chrilwe.autocreatetable.start.common.Engine;
import cn.chrilwe.autocreatetable.start.common.MysqlColumnType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
  * 图片详情
 * @author chrilwe
 * 2020-9-9
 */
@Data
@ApiModel
@Entity
@Table(name = "tb_image_detail", engine = Engine.INNODB, charset = "utf8")
public class ImageDetail {

	@Primary
	@Column(name = "id", length = 6, type = MysqlColumnType.INT)
	@Notnull
	@AutoIncrement
	@ApiModelProperty(name = "id", value = "图片详情ID")
	private int id;
	
	@Column(name = "image_name", length = 150, type = MysqlColumnType.VARCHAR)
	@Notnull
	@ApiModelProperty(name = "imageName", value = "图片名称")
	private String imageName;
	
	@Column(name = "image_origin_name", length = 64, type = MysqlColumnType.VARCHAR)
	@Notnull
	@ApiModelProperty(name = "imageOriginName", value = "图片原始名称")
	private String imageOriginName;
	
	@Column(name = "image_name_ext", length = 10, type = MysqlColumnType.VARCHAR)
	@Notnull
	@ApiModelProperty(name = "imageNameExt", value = "图片名称扩展名")
	private String imageNameExt;
	
	@Column(name = "image_size", length = 6, type = MysqlColumnType.INT)
	@Notnull
	@ApiModelProperty(name = "imageSize", value = "图片名小")
	private long imageSize;
	
	@ApiModelProperty(name = "status", value = "图片使用状态 ")
	@Column(name = "status", length = 1, type = MysqlColumnType.INT)
	@Notnull
	private int status;//0.删除 1.正常

	@Column(name = "image_url", length = 150, type = MysqlColumnType.VARCHAR)
	@Notnull
	@ApiModelProperty(name = "imageUrl", value = "图片地址")
	private String imageUrl;
	
	@ApiModelProperty(name = "userId", value = "图片上传人的ID ")
	@Column(name = "user_id", length = 6, type = MysqlColumnType.INT)
	@Notnull
	private int userId;
}
